
package ch.hearc.meteo.imp.afficheur.real.vue;

import java.awt.BorderLayout;
import java.awt.Toolkit;

import javax.swing.JPanel;
import javax.swing.JSplitPane;

import ch.hearc.meteo.imp.afficheur.real.vue.atome.JPanelStationMeteoCarteElement;

public class JPanelCentral extends JPanel
	{

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/

	public JPanelCentral()
		{
		geometry();
		control();
		apparence();
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/
	public void addMarker(JPanelStationMeteoCarteElement carteElement)
		{
		this.panelMap.addMarker(carteElement);
		}

	public void removeMarker(JPanelStationMeteoCarteElement carteElement)
		{
		this.panelMap.removeMarker(carteElement);
		panelInformationsMeteo.removeStationMeteoSelectionnee(carteElement.getStationMeteoElement());

		}

	/*------------------------------*\
	|*				Set				*|
	\*------------------------------*/

	/*------------------------------*\
	|*				Get				*|
	\*------------------------------*/

	public JPanelMap getPanelMap()
		{
		return this.panelMap;
		}

	public JPanelInformationsMeteo getPanelInformationsMeteo()
		{
		return this.panelInformationsMeteo;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/
	private void geometry()
		{
		this.setLayout(new BorderLayout());
		panelMap = new JPanelMap();
		panelInformationsMeteo = new JPanelInformationsMeteo();

		JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panelMap, panelInformationsMeteo);
		splitPane.setDividerLocation((int)Toolkit.getDefaultToolkit().getScreenSize().getWidth() * 5 / 8);
		this.add(splitPane, BorderLayout.CENTER);
		}

	private void control()
		{

		}

	private void apparence()
		{

		}

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/

	private JPanelMap panelMap;
	private JPanelInformationsMeteo panelInformationsMeteo;
	}
